package terminal_enum

// 终端-终端扩展协议指令结果
type terminalExtInstructionResult int

var TerminalExtInstructionResult terminalExtInstructionResult

// 成功
func (c *terminalExtInstructionResult) Success() int {
	return 1
}

// 失败
func (c *terminalExtInstructionResult) Failure() int {
	return 2
}

func (c *terminalExtInstructionResult) ToText(value int) string {
	switch value {

	case 1:
		return "成功"

	case 2:
		return "失败"

	}
	return ""
}

func (c *terminalExtInstructionResult) ToValue(text string) int {
	switch text {

	case "成功":
		return 1

	case "失败":
		return 2

	}
	return 0
}
